<style scoped>

</style>

<template>
    <div style="width: 100%;height:calc(100vh - 50px);">
        <van-nav-bar
                title="群聊"
                @click-right="users"
        >
            <van-icon name="edit" slot="right"/>
        </van-nav-bar>

        <van-list
                v-model="loading"
                :finished="finished"
                finished-text="没有更多了"
                @load="onLoad"
        >
            <van-row
                    v-for="item in list"
                    :key="item"
                    :title="item">
                <van-col span="6">
                    <div style="text-align: center;margin: 5px 0px;">
                        <img src="../../../public/img/aaa.png"
                             style="height: 60%;width: 60%;"/>
                    </div>
                </van-col>
                <van-col span="18">
                    <van-cell :title=item.message :value=item.time :label=item.message @click="onDetails(item.message)"/>
                </van-col>

            </van-row>
        </van-list>
    </div>
</template>

<script>
    export default {
        name: "a1",
        data() {
            return {
                list: [
                    {
                        title: '1',
                        message: '1',
                        time: '1'
                    },
                    {
                        title: '2',
                        message: '2',
                        time: '2'
                    },
                    {
                        title: '3',
                        message: '3',
                        time: '3'
                    },

                ],
                loading: false,
                finished: false
            }
        },
        methods: {
            users() {
                console.log("aa");
            },
            onLoad() {
                // 异步更新数据
                let self = this;
                self.loading = false;
            },
            onDetails(roomId) {
                let self = this;
                self.$router.push({
                    name:'details',
                    path: '/details',
                    params: {
                        roomId:roomId,
                    }
                },);
            }
        },
    }
</script>

